#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableHeroDao:DaoBase<TableHero>
    {
        public override string GetFileName()
        {
            return "TableHero.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableHero>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableHero model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.heroId)) UnityEngine.Debug.LogError("数据表id重复:TableHero->id: " + model.heroId);
            #endif
            cachePrimaryInt[model.heroId] = model;
        }
        protected override TableHero ParseRowData(string[] rowData)
        {
            TableHero data = new TableHero();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.heroId = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.heroName = string.Intern(rowData[1]);
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.gender = int.Parse(rowData[2]);
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.heroDesc = rowData[3];
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.heroFeature = rowData[4];
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.heroStyle = string.Intern(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.heroAttackTarget = string.Intern(rowData[6]);
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.heroAbility = string.Intern(rowData[7]);
            }
            if (!string.IsNullOrEmpty(rowData[8]))
            {
                data.skillsIntroduction = rowData[8];
            }
            if (!string.IsNullOrEmpty(rowData[9]))
            {
                data.isHero = int.Parse(rowData[9]);
            }
            if (!string.IsNullOrEmpty(rowData[10]))
            {
                data.heroInManual = int.Parse(rowData[10]);
            }
            if (!string.IsNullOrEmpty(rowData[11]))
            {
                data.heroType = int.Parse(rowData[11]);
            }
            if (!string.IsNullOrEmpty(rowData[12]))
            {
                data.expedtionSkills = string.Intern(rowData[12]);
            }
            if (!string.IsNullOrEmpty(rowData[13]))
            {
                data.heroGroupId = int.Parse(rowData[13]);
            }
            if (!string.IsNullOrEmpty(rowData[14]))
            {
                data.heroBossTitle = string.Intern(rowData[14]);
            }
            if (!string.IsNullOrEmpty(rowData[15]))
            {
                data.defaultStar = int.Parse(rowData[15]);
            }
            if (!string.IsNullOrEmpty(rowData[16]))
            {
                data.maxStar = int.Parse(rowData[16]);
            }
            if (!string.IsNullOrEmpty(rowData[17]))
            {
                data.quality = int.Parse(rowData[17]);
            }
            if (!string.IsNullOrEmpty(rowData[18]))
            {
                data.modelId = int.Parse(rowData[18]);
            }
            if (!string.IsNullOrEmpty(rowData[19]))
            {
                data.heroPaint = string.Intern(rowData[19]);
            }
            if (!string.IsNullOrEmpty(rowData[20]))
            {
                data.recruitPoint = rowData[20];
            }
            if (!string.IsNullOrEmpty(rowData[21]))
            {
                data.fragItemId = int.Parse(rowData[21]);
            }
            if (!string.IsNullOrEmpty(rowData[22]))
            {
                data.soulItemId = int.Parse(rowData[22]);
            }
            if (!string.IsNullOrEmpty(rowData[23]))
            {
                data.soulExchangeFragNum = int.Parse(rowData[23]);
            }
            if (!string.IsNullOrEmpty(rowData[24]))
            {
                data.fragNeedNum = int.Parse(rowData[24]);
            }
            if (!string.IsNullOrEmpty(rowData[25]))
            {
                data.diposeFragNum = int.Parse(rowData[25]);
            }
            if (!string.IsNullOrEmpty(rowData[26]))
            {
                data.atk = double.Parse(rowData[26]);
            }
            if (!string.IsNullOrEmpty(rowData[27]))
            {
                data.def = double.Parse(rowData[27]);
            }
            if (!string.IsNullOrEmpty(rowData[28]))
            {
                data.hp = double.Parse(rowData[28]);
            }
            if (!string.IsNullOrEmpty(rowData[29]))
            {
                data.speed = double.Parse(rowData[29]);
            }
            if (!string.IsNullOrEmpty(rowData[30]))
            {
                data.cri = double.Parse(rowData[30]);
            }
            if (!string.IsNullOrEmpty(rowData[31]))
            {
                data.anticri = double.Parse(rowData[31]);
            }
            if (!string.IsNullOrEmpty(rowData[32]))
            {
                data.hit = double.Parse(rowData[32]);
            }
            if (!string.IsNullOrEmpty(rowData[33]))
            {
                data.dodge = double.Parse(rowData[33]);
            }
            if (!string.IsNullOrEmpty(rowData[34]))
            {
                data.attributeBase = string.Intern(rowData[34]);
            }
            if (!string.IsNullOrEmpty(rowData[35]))
            {
                data.winSound = string.Intern(rowData[35]);
            }
            if (!string.IsNullOrEmpty(rowData[36]))
            {
                data.enterSound = string.Intern(rowData[36]);
            }
            if (!string.IsNullOrEmpty(rowData[37]))
            {
                data.formationOnSound = rowData[37];
            }
            if (!string.IsNullOrEmpty(rowData[38]))
            {
                data.normalSound = rowData[38];
            }
            if (!string.IsNullOrEmpty(rowData[39]))
            {
                data.ModelParticleStarLimit = int.Parse(rowData[39]);
            }
            if (!string.IsNullOrEmpty(rowData[40]))
            {
                data.heroGraph = string.Intern(rowData[40]);
            }
            if (!string.IsNullOrEmpty(rowData[41]))
            {
                data.heroPosition = string.Intern(rowData[41]);
            }
            if (!string.IsNullOrEmpty(rowData[42]))
            {
                data.heroActor = string.Intern(rowData[42]);
            }
            if (!string.IsNullOrEmpty(rowData[43]))
            {
                data.introSkillId = int.Parse(rowData[43]);
            }
            if (!string.IsNullOrEmpty(rowData[44]))
            {
                data.extraHeroGroups = rowData[44];
            }
            return data;
        }
    }
}
